<script language="javascript">
{literal}
jQuery(document).ready(function() {
 	jQuery(".list_top").each(function(){
			jQuery(this).click(function(){
				var sub_id=this.lang;
				
				jQuery(".list_sub"+sub_id).each(function(){
					jQuery(this).toggle();
				});
			});	
	});		
});	
{/literal}
</script>

<div class="enbac-bound">
<span style="display:block;" id="advanced_search_template">
	<table cellpadding="4" width="100%" class="enbac-form-bound">
	<tr>
		<td width="41%"  class="enbac-form-title" style="font-size:18px"><a href="category.html"><strong>Quản trị Danh mục</strong></a> [<a href="category.html?mod=zone"><strong>Quản trị Nhóm danh mục</strong></a>]  [ <a href="category.html?cmd=filter_list">Quản trị thuộc tính</a> ]</td>
        <td width="19%" class="form_title_button"><a href="category.html?cmd=add"><img alt="" src="style/images/admin/new_f2.png" style="text-align:center" class="icon_cmd"/><br>
			Thêm mới</a></td>
        <td width="19%" class="form_title_button"><a href="javascript:void(0);" onClick="ListCategoryForm.cmd.value='delete';ListCategoryForm.submit();"><a href="javascript:void(0);" onclick="{literal}if(!confirm('Bạn có chắc chắn xoá các Danh mục chọn không?')){return false}{/literal}ListCategoryForm.cmd.value='delete';ListCategoryForm.submit();"><img alt="Delete" src="style/images/admin/cancel_f2.png" class="icon_cmd"/><br>
			Xoá danh mục chọn</a></td>
        <td width="21%" class="form_title_button"><a href="javascript:void(0);" onclick="ListCategoryForm.cmd.value='delete';ListCategoryForm.submit();"><a href="category.html?cmd=del_cache">Xoá cache Danh mục</a></td>
	</tr></table>
</span>
<div class="form_bound">
<div class="form_content">
		<table width="100%" cellpadding="0" cellspacing="0" border="1" style="border-collapse:collapse" bordercolor="#C3C3C3">
<thead>
			<tr  valign="middle" bgcolor="#E6E6E6" style="line-height:20px;height:30px">
				<th width="20" title="check_all" align="center">
			  <input type="checkbox" value="1" id="Category_all_checkbox" onClick="selectAllCheckbox(this.form,'Category',this.checked,'#FFFFEC','white');" style="cursor:pointer"></th />
				<th align="center" width="30" >ID</th />
				<th width="20" align="center" nowrap>Ảnh</th>
			  <th align="left" nowrap>T&ecirc;n	danh	m&#7909;c</th>
			  <th width="50" align="center" nowrap="nowrap">L&ecirc;n</th>
			  <th width="50" align="center" nowrap="nowrap">Xu&#7889;ng</th>
			  <th align="center" nowrap>Tr&#7841;ng th&aacute;i</th>
				<th align="center" valign="middle" nowrap>Vị trí</th>
		  </tr>
		  </thead>
			<tbody>
            
           
			{foreach from=$items item=items}
            	 <tr bgcolor="{cycle values='#F7F7F7,#ffffff'}" valign="middle" style="cursor:hand;" id="Category_tr_{$items.id}">
                    <td align="center"><input name="selected_ids[]" type="checkbox" value="{$items.id}" onClick="select_checkbox(this.form,'Category',this,'#FFFFEC','white');" id="Category_checkbox" style="cursor:pointer"></td>
                    <td width="30" align="center">{$items.id}</td>
                   <td width="20" align="center" nowrap >
                    <div style="margin:2px;width:52px; height:52px;vertical-align:middle;border:1px solid #CCC" align="center">
                 <a href="{$items.image_src}" target="_blank" style="display:block">
                 <img src="{$items.image}" alt="No image" name="preview_image" width="50" height="50"  id="preview_image"/>                 </a> </div>   
                 {if $items.del_image}<a href="{$items.del_image}">Xoá ảnh</a>{/if}                   </td>
                   <td align="left" nowrap ><div style="padding:4px;"><a title="Click vào để sửa" href="{$items.edit_link}"><strong>{$items.name}</strong></a> {if $items.sub_cat}<a href="javascript:void(0)" lang="{$items.id}"  class="list_top"><img src="style/images/menu/arrow-down.gif" title="Hiển thị danh mục con" style="margin-left:5px" align="absmiddle"/></a>{/if}</div></td>
                   <td width="50" align="center" nowrap="nowrap" >{$items.up}</td>
                   <td width="50" align="center" nowrap="nowrap">{$items.down}</td>
                   <td align="center" nowrap >
                      {$items.status}                    </td>
                <td align="left" valign="middle" nowrap style="padding:4px">{$items.position}</td>
          </tr>
                  {if $items.sub_cat}
                      {foreach from=$items.sub_cat item=sub_cat}
                      <tr bgcolor="{cycle values='#F7F7F7,#ffffff'}" valign="middle" style="cursor:hand;display:none" id="Category_tr_{$sub_cat.id}" class="list_sub{$items.id}">
                            <td><input name="selected_ids[]" type="checkbox" value="{$sub_cat.id}" onClick="select_checkbox(this.form,'Category',this,'#FFFFEC','white');" id="Category_checkbox" style="cursor:pointer"></td>
                            <td width="30" align="center">{$sub_cat.id}</td>
                     <td width="20" align="center" nowrap >
<div style="margin:2px;width:52px; height:52px;vertical-align:middle;border:1px solid #CCC" align="center">
                             <a href="{$sub_cat.image_src}" target="_blank" style="display:block">
                             <img  id="preview_image" alt="No image" src="{$sub_cat.image}" width="50" height="50"/>                             </a>                             </div> {if $sub_cat.del_image}<a href="{$sub_cat.del_image}">Xoá ảnh</a>{/if}                            </td>
                        <td align="left" nowrap ><div style="padding:14px;">-----<a style="margin-left:5px" title="Click vào để sửa" href="{$sub_cat.edit_link}">{$sub_cat.name}</a> {if $sub_cat.subcat}<a href="javascript:void(0)" lang="{$sub_cat.id}"  class="list_top"><img src="style/images/menu/arrow-down.gif" title="Hiển thị danh mục con" style="margin-left:5px" align="absmiddle"/></a>{/if}</div></td>
                        <td width="50" align="center" nowrap="nowrap" >{$sub_cat.up}</td>
                        <td width="50" align="center" nowrap="nowrap">{$sub_cat.down}</td>
                        <td align="center" nowrap >
                            {$sub_cat.status}                            </td>
                        <td align="left" valign="middle" nowrap  style="padding:4px">-----{$sub_cat.position}</td>
          </tr>
                        {if $sub_cat.subcat}
                          {foreach from=$sub_cat.subcat item=sub_cat2}
                          <tr bgcolor="{cycle values='#F7F7F7,#ffffff'}" valign="middle" style="cursor:hand;display:none" id="Category_tr_{$sub_cat2.id}" class="list_sub{$sub_cat.id}">
                                <td><input name="selected_ids[]" type="checkbox" value="{$sub_cat2.id}" onClick="select_checkbox(this.form,'Category',this,'#FFFFEC','white');" id="Category_checkbox" style="cursor:pointer"></td>
                                <td width="30" align="center">{$sub_cat2.id}</td>
                         <td width="20" align="center" nowrap >
    <div style="margin:2px;width:52px; height:52px;vertical-align:middle;border:1px solid #CCC" align="center">
                                 <a href="{$sub_cat2.image_src}" target="_blank" style="display:block">
                                 <img  id="preview_image" alt="No image" src="{$sub_cat2.image}" width="50" height="50"/>                             </a>                             </div> {if $sub_cat2.del_image}<a href="{$sub_cat2.del_image}">Xoá ảnh</a>{/if}                            </td>
                            <td align="left" nowrap ><div style="padding:14px;">--------------------<a style="margin-left:5px" title="Click vào để sửa" href="{$sub_cat2.edit_link}">{$sub_cat2.name}</a></div></td>
                            <td width="50" align="center" nowrap="nowrap" >{$sub_cat2.up}</td>
                            <td width="50" align="center" nowrap="nowrap">{$sub_cat2.down}</td>
                            <td align="center" nowrap >
                                {$sub_cat2.status}                            </td>
                            <td align="left" valign="middle" nowrap  style="padding:4px">--------------------{$sub_cat2.position}</td>
              </tr>
                        {/foreach}
                     {/if}
          
          
                    {/foreach}
                 {/if}
                 <tr bgcolor="{cycle values='#F7F7F7,#ffffff'}" valign="middle" style="cursor:hand;">
                    <td colspan="8" style="padding:4px;font-size:14px"><strong>&nbsp;</strong></td>
              </tr>
			{/foreach}
			</tbody>
	  </table>
	  <table width="100%"><tr>
		<td width="50%">
			<span class="enbac-select">L&#7921;a ch&#7885;n:&nbsp;</span>
			[ <a href="javascript:void(0);" onClick="selectAllCheckbox(document.ListCategoryForm,'Category',true,'#FFFFEC','white');">Chọn tất cả</a> ]
			[ <a href="javascript:void(0);" onClick="selectAllCheckbox(document.ListCategoryForm,'Category',false,'#FFFFEC','white');">Bỏ chọn</a> ]
			[ <a href="javascript:void(0);" onClick="selectAllCheckbox(document.ListCategoryForm,'Category',-1,'#FFFFEC','white');">Chọn ngược lại</a> ]		</td>
		<td align="right"><a href="category.html?cmd=optimize">Tối ưu vị trí</a> (Không dùng tuỳ tiện vì rất nặng hệ thống)</td>
	  </tr></table>
	  <table width="100%" class="table_page_setting">
</table>
	</div>
</div>
</div>
<input type="hidden" name="cmd" id="cmd" value="" />